﻿using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BUS;
using DTO;
public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void btnDangNhap_Click1(object sender, EventArgs e)
    {
        NguoiDungBUS ngdungBUS = new NguoiDungBUS();
        NguoiDungDTO ngdungDTO = new NguoiDungDTO();

        bool bKT = false;
        ngdungDTO.TENDANGNHAP = txtTenDangNhap.Text;
        ngdungDTO.MATKHAU = txtMatKhau.Text;
        bKT = ngdungBUS.DangNhap(ngdungDTO);
        if (bKT == true)
        {
            txtTenDangNhap.Visible = false;
            txtMatKhau.Visible = false;
            Label2.Visible = false;
            btnDangNhap.Visible = false;
            btnDangKy.Text = "Đăng xuất";
            Label1.Text = "Chào: " + txtTenDangNhap.Text;

        }
        else
        {
            Response.Write("Dang Nhap That Bai");
        }
    }
}
